(function ($) {
	$.fn.ExtDialog = function (settings) {
		
		/*****默认参数*****/
        var defaultSettings = {
        	/*字段配置，例子：
        	*/
        	
        	id: new Date().getTime(),
        	title: '',
        	url: '',
        	content: '',
        	width: 800,
        	height: 560,
        	
        	//Event
            //关闭窗口后
            close: function(data) {}
        }
        
        
        /*****应用参数*****/
        settings = $.extend(defaultSettings, settings);
        
        $this = this;
        var $container = null;
       	$container = parent.$('<div id="__extdialog_' + settings.id+'"></div>').append("<iframe id='modalFrame' src='" + settings.url + "' style='width:100%;height:98%;' frameborder=0/>").dialog({
					resizable: false,
					modal: true,
					autoOpen: false, 
					width: settings.width,
					height: settings.height, 
					title_html: false,
					title:settings.title,
					overlay: {
	                   opacity: 0.5,
	                   background: "black"
	                },
	                close:function(){
				        	var data = parent.window['__extdialog_sharedata'];
				        	delete parent.window['__extdialog_sharedata'];
				        	settings.close(data);
	                }
		});
        $container.dialog("open");
        parent.window['__extdialog_' + settings.id] = $container;    
       parent.window['__extdialog_active'] = $container;
       
	};
	
})(jQuery);
(function ($) {
	$.fn.ExtDialogSP = function (settings) {
		
		/*****默认参数*****/
        var defaultSettings = {
        	/*字段配置，例子：
        	*/
        	
        	id: new Date().getTime(),
        	title: '',
        	url: '',
        	content: '',
        	width: 800,
        	height: 560,
        	
        	//Event
            //关闭窗口后
            close: function(data) {}
        }
        
        
        /*****应用参数*****/
        settings = $.extend(defaultSettings, settings);
        
        $this = this;
        var $container = null;
       	$container = parent.$('<div id="__extdialog_' + settings.id+'"></div>').append("<iframe id='modalFrame' src='" + settings.url + "' style='width:100%;height:98%;' frameborder=0/>").dialog({
					resizable: false,
					modal: true,
					autoOpen: false, 
					width: settings.width,
					height: settings.height, 
					title_html: false,
					title:settings.title,
					overlay: {
	                   opacity: 0.5,
	                   background: "black"
	                },
	                close:function(){
				        	var data = parent.window['__extdialog_sharedata'];
				        	delete parent.window['__extdialog_sharedata'];
				        	settings.close(data);
	                }
		});
        $container.dialog("open");
        parent.window['__extdialog_' + settings.id] = $container;    
     
       
	};
	
})(jQuery);